package com.cloud.example;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;

@SpringBootApplication
@EnableDiscoveryClient
@RestController
@RefreshScope
public class CloudExampleApplication {

    public static void main(String[] args) {
        SpringApplication.run(CloudExampleApplication.class, args);
    }
    @Value("${name}")
    private String name;

    @RequestMapping(value = "/example", method = RequestMethod.GET)
    @ResponseBody
    public String example() {
        return name;
    }
}
